import 'package:provider/provider.dart';
import 'package:flutter/material.dart';
import '../models/counter_model.dart';

class SettingsPage extends StatelessWidget{
  const SettingsPage({super.key});

  @override
  Widget build(BuildContext context) {
    final model = context.watch<CounterModel>();
    return Scaffold(
      appBar: AppBar(title: const Text('Settings'),),
      body: Padding(
        padding: const EdgeInsets.all(20),
        child: Column(
          children: [
            SwitchListTile(
            title: const Text('Dark Mode'),
            value: model.theme=="dark", 
                onChanged: (_)=>model.toggleTheme()),
            ElevatedButton(onPressed: model.reset, 
                child: const Text('Reset Counter'))
          ],
        ),
      ),
    );
  }
  
  
}